home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 47
/
MOBICLIC 47.ISO
/
mac
/
DATA
/
DemoAtlas
/
demo.cst
/
00003_Script_gestion du son
< prev
next >
Wrap
Text File
|
2002-07-23
|
2KB
|
79 lines
-- gestion du son
global dernierSon,nivSon,volumeOn,menusActifs,ouvreVolume, chemin
-- dernierSon : nom du dernier son jouΘ
-- nivSon : liste α 3 termes contenant le niveau sonore de chaque piste
-- volumeOn : indique si la fenΩtre de rΘglage du volume est active
-- lecture d'un son
on joueSon nom, n
if the paramCount = 1 then
n = 3
end if
if voidP(nivSon)=1 then
nivSon=[255,255,255]
end if
-- ajout Θventuel de "sons:"
if char 1 to 9 of nom <> "sons" then
if offset(":", nom) = 0 then
nom = "sons:" & nom
end if
end if
dernierSon = nom
--
put the pathName & nomDos(nom) & ".aif" into nom
put " Son jouΘ : " & dernierSon
sound playFile n, nom
-- rΘglage du niveau des autres canaux
repeat with i=1 to 3
if i<>n and nivSon[i]>102 then
sound(i).volume = 110
end if
end repeat
end joueSon
-- jouer un son du cyberCalendrier
on sonCyber son
ns=char 6 to 7 of the movieName
joueson ns & "_" & son
end
-- rΘglage du volume
on niveauSon
if voidP(nivson) = 1 then
nivson=[255,255,255]
end if
repeat with i=1 to 3
sound(i).volume = nivSon[i]
end repeat
end nivSon
-- attendre la fin d'un son
on attendreSon p
set T = 1.0/the frameTempo
repeat while soundBusy(p)
updateStage
temporise(T)
end repeat
end
-- dΘsactivation des pistes audio
on coupeSon
repeat with i=1 to the paramCount
if value(param(i))<>0 then
puppetSound (param(i)),0
else
listeSons param(i)
end if
end repeat
end coupeSon
on listeSons chaine
n=offset(">", chaine)
n1=value(char 1 to n-1 of chaine)
n2=value(char n+1 to length(chaine) of chaine)
repeat with j=n1 to n2
puppetSound j,0
end repeat
end listeSons